﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProList.ascx.cs" Inherits="admin_Products_ProList" %>
<%@ Register Src="~/Admin/Control/Pager/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<%@ Register Assembly="GroupDropDownList" Namespace="GroupDropDownList" TagPrefix="cc1" %>

<%@ Import Namespace="WB.Library" %>
<h2>
    Danh sách sản phẩm
</h2>
<div style="margin-bottom: 15px">
    <table width="100%">
       
        <tr>
            <td width="90px">
                Loại sản phẩm
            </td>
            <td>
                <%--<asp:DropDownList ID="ddlCategory" runat="server" Width="450px" AppendDataBoundItems="true">
                    <asp:ListItem Value="00000000-0000-0000-0000-000000000000">-- Chọn --</asp:ListItem>
                </asp:DropDownList>--%>
                
                <cc1:GroupDropDownList ID="ddlCategory" runat="server" Width="450px" AppendDataBoundItems="true">
                    <asp:ListItem Value="00000000-0000-0000-0000-000000000000">-- Chọn --</asp:ListItem>
                </cc1:GroupDropDownList>
                
            </td>
        </tr>
        <tr>
            <td width="90px">
                Tên sản phẩm
            </td>
            <td>
                <asp:TextBox ID="txtTitle" runat="server" Width="450px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
               
            </td>
            <td>
                 <asp:Button ID="btnSearch" runat="server" Text="Tìm" 
                     onclick="btnSearch_Click" />
                <asp:Button ID="btnAddNews" runat="server" Text="Thêm mới" onclick="btnAddNews_Click" 
                    />
            </td>
        </tr>
    </table>
</div>
<table class="table">
    <tr>
        <th width="50px">
            STT
        </th>
        <th>
            Tên sản phẩm
        </th>
        <th>
            Mã sản phẩm
        </th>
        <th>
            Loại sản phẩm
        </th>
        
        <th>
            Hình ảnh
        </th>
        <th>
            Mô tả
        </th>
        <th>
            Thông tin chi tiết
        </th>
        <th>
            Giá
        </th>
        <th width="120px">
            Ngày đăng
        </th>
        <th width="40px">
            Xóa
        </th>
    </tr>
    <asp:Repeater ID="rep" runat="server" onitemcommand="rep_ItemCommand">
        <ItemTemplate>
            <tr>
                <td align="center">
                    <%# Container.ItemIndex + 1 %>
                </td>
                <td>
                    <a href='?control=PProAddEdit&id=<%# Eval("Id") %>'>
                    <%# Eval("ProductName")%>
                    </a>
                </td>
                <td>
                    <%#Eval("ProductCode")%>
                </td>
                <td>
                    <%# Eval("CatName")%>
                </td>
                <td>
                  <img src='<%# !string.IsNullOrEmpty(Eval("Photo").ToString()) ? Eval("Photo").ToString() : "img/img-07.png" %>' style="width:100px;height:100px:"/>
                </td>
                <td>
                    <%#Eval("Title")%>
                </td>
                <td>
                    <%#Eval("Specification")%>
                </td>
                <td>
                    <%#Eval("Price")%>
                </td>
                <td>
                    <%# Eval("CreatedDate") %>
                </td>
                <td align="center">
                    <asp:LinkButton ID="del" runat="server" CommandName="del" CommandArgument='<%# Eval("Id") %>' OnClientClick="return confirm('Bạn xác nhận xóa dữ liệu?')"><img src="images/delete.png" /></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</table>
<uc1:Pager ID="Pager1" runat="server"/>